/*
 * TickableManager.h
 *
 *  Created on: 2009/01/12
 *      Author: elecgon
 */

#ifndef TICKABLEMANAGER_H_
#define TICKABLEMANAGER_H_

#include <vector>

#ifndef ISINGLETON_H_
#	include "core/ISingleton.h"
#endif

#ifndef TICKABLE_H_
#	include "active/Tickable.h"
#endif



class TickableManager: public ISingleton<TickableManager>
{
public:
	TickableManager();
	virtual ~TickableManager();

public:
	static TickableManager& GetInstance()
	{
		assert(m_pInstance);
		return *m_pInstance;
	}
	static TickableManager* GetInstancePtr()
	{
		return m_pInstance;
	}

public:
	void add(Tickable* t);
	void sub(Tickable* t);
	void tick();

private:
	vector<Tickable*> mTickables;
	uint32 mLastTime;
};

#endif /* TICKABLEMANAGER_H_ */
